package top.shiyiri.spring5.bean;

        import org.springframework.beans.BeansException;
        import org.springframework.beans.factory.config.BeanPostProcessor;
        import org.springframework.core.Ordered;

/**
 * @author Aunean
 * @date 2022/2/17 14:41
 */
public class MyBeanPost implements BeanPostProcessor, Ordered {

    @Override
    public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
        System.out.println("在初始化之前执行的方法");
        return null;
    }

    @Override
    public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
        System.out.println("在初始化之后执行的方法");
        return null;
    }

    @Override
    public int getOrder() {
        return 5;
    }
}
